﻿// *----------------------------------------------------------------
// Copyright (C) 2017 通通优品
// 版权所有。
// 
// 类名：IApiHttpClient.cs
// 功能描述：TongTongMall.MallWeb.ApiRepository
// 
// Create User：jym 2017/02/28
// 
// Edit User：UserName,EditTime
// Describe：Describe
// ----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace TongTongMall.MallWeb.ApiRepository.Domain
{
    public interface IApiHttpClient
    {

        /// <summary>
        /// Post url 
        /// 参数按照application/x-www-form-urlencoded传递
        /// </summary>
        /// <param name="apiUri">post地址</param>
        /// <param name="httpContents">参数</param>
        /// <returns></returns>
        Task<HttpResponseMessage> PostAsync(Uri apiUri, IDictionary<string, StringContent> httpContents);

        /// <summary>
        /// POST url
        /// </summary>
        /// <param name="apiUri">post地址</param>
        /// <param name="content">post内容</param>
        /// <param name="timeout">相应超时时间，为空默认90秒</param>
        /// <returns></returns>
        Task<HttpResponseMessage> PostAsync(string apiUri, object content, int? timeout = null);
    }
}
